﻿using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action.Zerg
{
	public class ActionProduceUltralisk : ActionProduceFromLarva
	{
		public static ActionProduceUltralisk Instance = new ActionProduceUltralisk();
		private ActionProduceUltralisk() : base(70, 300, 200, 6) { }
		public override bool HaveTechnology(IBuildOrder bo)
		{
			ZergState state = bo.State as ZergState;
			return state.UltraliskCavern.Count > 0;
		}
		public override void OnProductionFinished(IBuildOrder bo)
		{
			ZergState state = bo.State as ZergState;
			state.Ultralisk++;
		}
		public override string EventName { get { return "ActionSpawnUltralisk"; } }
		public override bool IsInvalid(Jay.Sc2.Bof.Lib.State.IBuildOrder bo)
		{
			ZergState state = bo.State as ZergState;
			return base.IsInvalid(bo) || state.UltraliskCavern.Total == 0;
		}
		private IAction[,] m_Requirements;
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionProduceUltraliskCavern.Instance } };
				return m_Requirements;
			}
		}
	}
}
